from datetime import timedelta
import redis
import os

class Config:
    MONGODB_SETTINGS = {
        'db': 'test_db',
        'mongo_client_class': 'mongomock.MongoClient',  # 关键修改点
        'host': 'localhost',  # 普通host即可
        'connect': False
    }
    JWT_ACCESS_TOKEN_EXPIRES = timedelta(minutes=2)#ticket
    JWT_REFRESH_TOKEN_EXPIRES = timedelta(hours=1)
    REDIS_HOST = "localhost"
    REDIS_PORT = 6379
    REDIS_DB = 0
    REDIS_PASSWORD = os.getenv('REDIS_PASSWORD')
    JWT_REDIS_TOKEN_EXPIRES = 3600 
    SECRET_KEY = 'super-secret-key'
    TICKET_EXPIRATION = 300  # 5分钟
    SIGNING_SECRET = os.getenv('SIGNING_SECRET', 'signature-secret')
    